<template>
	<el-dialog v-model="state.visible" :destroy-on-close="true" :width="800" top="5" :title="`${state.title}-流程图预览`">
		<el-image style="width: 100%; height: 100%" :src="state.url" fit="fit" />
		<template #footer>
			<el-button @click="state.visible = false">取消</el-button>
		</template>
	</el-dialog>
</template>

<script setup lang="ts" name="FlowImageDialog">
import { ref, reactive } from 'vue';
// import FlowView from './components/FlowView';
import { ElMessage, FormInstance, ElMessageBox } from 'element-plus';


//定义弹框props参数
interface DialogProps {
	title: string;
	deployId: string;
	apiUrl?: (params: any) => Promise<any>;
}

// drawer框状态
const state = reactive({
    url: '',
    visible: false,
    title: ''
});

// 接收父组件传过来的参数
const acceptParams = (params: DialogProps): void => {
	state.visible = true;
    state.title = params.title
    state.url = '/api/flow/definition/readImage?deployId=' +  params.deployId

};

defineExpose({
	acceptParams,
});
</script>
